package collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

// Collection接口
public class Test1 {
    public static void main(String[] args) {

        Collection<String> list = new ArrayList<>();
        Collection<Integer> list2 = new ArrayList<>();
        // <>里只能放类类型，基本类型->包装类
        list.add("dwd");
        list.add("1");
        list.add("2");
//        list.add(1);

//        list.clear();// 清空
        list.isEmpty();// 是否为空
//        Object[] objects = list.toArray();// 将集合中的元素变为数组接受
//        System.out.println(Arrays.toString(objects));


        String[] strings = {"aaaa","bbbb","cccc"};
        System.out.println(strings.getClass());
        Object[] objects = (Object[])strings;
        System.out.println(objects.getClass());

//        Object[] objects = {"aaaa","bbbb","cccc"};
//        System.out.println(objects.getClass());
//        System.out.println(objects[0].getClass());
//        String[] strings = (String[])objects;
//        System.out.println(strings.getClass());


    }
}
